/*
    SUSAN® - Sole of Unix Save ANything

   Copyright (C) 2016-2019 Skyatlas co. ltd

   
*/

#ifndef BAREOS_DIRD_NEXT_VOL_H_
#define BAREOS_DIRD_NEXT_VOL_H_

namespace directordaemon {

void SetStorageidInMr(StorageResource* store, MediaDbRecord* mr);
int FindNextVolumeForAppend(JobControlRecord* jcr,
                            MediaDbRecord* mr,
                            int index,
                            const char* unwanted_volumes,
                            bool create,
                            bool purge);
bool HasVolumeExpired(JobControlRecord* jcr, MediaDbRecord* mr);
void CheckIfVolumeValidOrRecyclable(JobControlRecord* jcr,
                                    MediaDbRecord* mr,
                                    const char** reason);
bool GetScratchVolume(JobControlRecord* jcr,
                      bool InChanger,
                      MediaDbRecord* mr,
                      StorageResource* store);

} /* namespace directordaemon */

#endif  // BAREOS_DIRD_NEXT_VOL_H_
